<script type="text/javascript">
function onSync() {
	var url = window.location.pathname+"/sync";
	$.ajax({
		type : "get",
		url : url,
		dataType : "json",
		success : function(json) {
			if (json.result && json.result == "success") {
				common.showTip({
					success : true,
					title : localeMsg.common.info,
					text : localeMsg.common.syncSuccess,
					callback : function() {
						//刷新当前页面
						window.location.href=window.location.href;
					}
				});
			} else {
				common.showTip({
					success : false,
					title : localeMsg.common.warn,
					text : localeMsg.common.syncFailed,
				});
			}
		}
	});
}
</script>
<a id="syncServerBtn" class="btn btn-default"
		href="javascript:void(0);" onclick="onSync();"><@spring.message code='server.synchronize'/></a>
<#include "/component/pagination.html" />
<table class="table table-striped table-hover">
	<thead>
		<tr>
			<th width="10%" scope="col"><@spring.message code="osd.name"/></th>
			<th width="10%" scope="col"><@spring.message code="osd.status"/></th>
			<th width="5%" scope="col"><@spring.message code="osd.crushweight"/></th>
			<th width="10%" scope="col"><@spring.message code="osd.devicestatus"/></th>
			<th width="10%" scope="col"><@spring.message code="osd.total"/></th>
			<th width="12%" scope="col"><@spring.message code="osd.used"/></th>
			<th width="10%" scope="col"><@spring.message code="osd.available"/></th>
			<th width="10%" scope="col"><@spring.message code="osd.percentused"/></th>
			<th width="10%" scope="col"><@spring.message code="osd.server"/></th>
			<th width="13%" scope="col"><@spring.message code="osd.path"/></th>
		</tr>
	</thead>
	<tbody>
		<#list pager.list as item>
		<tr
			<#if ((item_index+1) % 2 == 0) >class="oddrow"</#if>>
			<td>${item.name}</td>
	        <td>${item.in}-${item.up}</td>
	        <td>${item.crushWeight}</td>
	        <td>${item.stats}</td>
	        <td>${item.totalCapacity}</td>
	        <td>${item.usedCapacity}</td>
	        <td>${item.availCapacity}</td>
	        <td>${item.perUsed}</td> 
	        <td>${item.server}</td>
	        <td>${item.path}</td>
	       </tr>
		</#list>
	</tbody>
</table>
<@pagination/>
